package LeetCode;

import java.util.ArrayList;
import java.util.List;

public class LC_448_FindAllNumbersDisappearedinanArray {

    public static void main(String[] args) {

    }

    public class Solution {
        public List<Integer> findDisappearedNumbers(int[] nums) {
            int length = nums.length;
            int[] hash = new int[length];

            List<Integer> result = new ArrayList<>();
            for (int num : nums)
                hash[num - 1]++;
            for (int i = 0; i < length; i++)
                if (hash[i] == 0)
                    result.add(i + 1);
            return result;
        }
    }

}